package com.ysy.persimmons.common.request;

import com.fasterxml.jackson.annotation.JsonIgnore;


import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.StringUtils;



/**
 * @since 2023-03-19
 * 游标翻页请求
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class CursorPageBaseReq {

    /**
     * 页面大小
     */
    private Integer pageSize = 10;

    /**
     * 游标（初始为null，后续请求附带上次翻页的游标）
     */
    private String cursor;

    /**
     * 查询的用户id
     */
    private Long userId;


    @JsonIgnore
    public Boolean isFirstPage() {
        return StringUtils.isEmpty(cursor);
    }
}
